{-
	Copyright (c) 2009 Aitor Lopez Fadrique <mailto:aitorlf@gmail.com>
	All rights reserved
	Licensed under GNU LGPL v2.1

	$Id: GermanSouthernDeck.hs 15 2009-09-28 21:16:23Z aitorlf $

	This program is free software; you can redistribute it and/or
	modify it under the terms of the GNU Lesser General Public
	License version 2.1 (and just under that one) as published by
	the Free Software Foundation.

	This program is distributed in the hope that it will be useful,
	but without any warranty; without even the implied warranty of
	merchantability or fitness for a particular purpose. See the GNU
	Lesser General Public License for more details.

	You should have received a copy of the GNU Lesser General Public
	License along with this program; if not, write to the Free
	Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
	MA 02111-1307, USA.
-}

{-|
	Module		: Games.Cards.Deck.GermanSouthernDeck
	Copyright	: (c) Aitor Lopez Fadrique <mailto:aitorlf@gmail.com>
	License		: GNU LGPL v2.1 <http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html>

	Maintainer	: Aitor Lopez Fadrique <mailto:aitorlf@gmail.com>
	Stability	: provisional
	Portability	: portable

	Definition of the German Southern (36 cards) deck according to Games.Cards.Deck.

	This module defines the basic German 36 cards Southern deck. This deck is also known
	as Wilhem Tell accross the Eastern Europe, reason why it has been so aliased.
	In addition, there is a special Austrian deck which has an additional wild card, the
	/Weli/. Usually corresponding to /VI Schellen/, few decks perform it as an additional
	card.
-}
module Games.Cards.Deck.GermanSouthernDeck(
		-- * German 36 cards Southern deck
		-- ** Types defining cards and decks for the German Southern deck
		GermanSouthernRank(..),
		WilhemTellRank,
		Weli(..),
		GermanSuit(..),
		GermanSouthernCard,
		WilhemTellCard,
		AustrianWeliCard,
		GermanSouthernDeck,
		WilhemTellDeck,
		AustrianWeliDeck,
		-- ** Instance of German Southern deck
		germanSouthernDeck,
		wilhemTellDeck,
		austrianWeliDeck,
	)where

import Games.Cards.Deck
import Games.Cards.Deck.GermanClassicDeck


-- | Well-known ranks for the Southern German deck.
data GermanSouthernRank =
		-- | 'VI' (/Six 6/)
		VI
		-- | 'VII' (/Seven 7/)
		| VII
		-- | 'VIII' (/Eight 8/)
		| VIII
		-- | 'IX' (/Nine 9/)
		| IX
		-- | 'X' (/Ten 10/)
		| X
		-- | 'Under' (/Lower Jack/)
		| Under
		-- | 'Ober' (/Upper Jack/)
		| Ober
		-- | 'Konig' (/King/)
		| Konig
		-- | 'Daus' (/2/)
		| Daus
	deriving (Eq, Ord, Enum, Bounded, Show, Read)
instance CardRank GermanSouthernRank
-- | Alias @'GermanSouthernRank'@ as @'WilhemTellRank'@.
type WilhemTellRank = GermanSouthernRank


-- | Special @'WildCard'@ for /Austrian Weli/ deck.
data Weli = Weli
	deriving(Eq, Show, Read)
-- Trivial instanciation to be available as @'WildCard'@, returning the only element once.
instance WildCard Weli where
	wildcardSet = replicate 1 Weli


-- | Definition of the 36 cards Southern German @'Card'@s and @'Deck'@s.

-- | German Southern card type.
type GermanSouthernCard = Card GermanSouthernRank GermanSuit WildCardNone
-- | Alias @'GermanSouthernCard'@ as @'WilhemTellCard'@.
type WilhemTellCard = GermanSouthernCard

-- | Austrian Weli card type.
type AustrianWeliCard = Card GermanSouthernRank GermanSuit Weli

-- | German Southern deck type.
type GermanSouthernDeck = Deck GermanSouthernRank GermanSuit WildCardNone
-- | Alias @'GermanSouthernDeck'@ as @'WilhemTellDeck'@.
type WilhemTellDeck = GermanSouthernDeck

-- | Austrian Weli deck type.
type AustrianWeliDeck = Deck GermanSouthernRank GermanSuit Weli

-- | German Southern deck instance.
germanSouthernDeck :: GermanSouthernDeck
germanSouthernDeck = deck

-- | Wilhem Tell deck instance.
wilhemTellDeck :: GermanSouthernDeck
wilhemTellDeck = germanSouthernDeck

-- | Austrian Weli deck instance.
austrianWeliDeck :: AustrianWeliDeck
austrianWeliDeck = deck
